package com.guoteng.androidlearn;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

public class TextViewActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_text_view);

        TextView textView = (TextView) findViewById(R.id.textView);

    }

    public void showClick(View view) {

        Log.d("TextViewActivity", "~~~~~~~ 测试 ~~~~~~~");

        TextView textView = (TextView) findViewById(R.id.textView);

        Intent intent = getIntent();
        String showText = intent.getStringExtra("data_return");
        Log.d("TextViewActivity", showText);
        textView.setText(showText);

        Toast.makeText(getApplicationContext(), showText, Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onBackPressed() {

        Intent intent = new Intent();
        intent.putExtra("back", "大萌儿，我依然爱你❤️");
        setResult(RESULT_OK, intent);
        finish();

    }

}
